<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>规则解读 - 智能彩票预测助手</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" rel="stylesheet">
    <style>
        :root {
            --primary-color: #1E88E5;
            --secondary-color: #FFC107;
            --background-color: #F5F5F5;
            --text-color: #333333;
        }

        body {
            background-color: var(--background-color);
            color: var(--text-color);
        }

        .navbar {
            background-color: var(--primary-color);
            color: white;
        }

        .sidebar {
            background-color: white;
            min-height: calc(100vh - 56px);
            box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        }

        .nav-link {
            color: var(--text-color);
        }

        .nav-link:hover {
            background-color: var(--background-color);
        }

        .nav-link.active {
            background-color: var(--primary-color);
            color: white;
        }

        .card {
            border: none;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            margin-bottom: 20px;
        }

        .rule-section {
            margin-bottom: 20px;
            padding: 15px;
            border-radius: 5px;
            background-color: white;
        }

        .rule-section h5 {
            color: var(--primary-color);
            margin-bottom: 15px;
        }

        .chat-container {
            height: 400px;
            overflow-y: auto;
            padding: 15px;
            background-color: white;
            border-radius: 5px;
        }

        .chat-message {
            margin-bottom: 15px;
            padding: 10px;
            border-radius: 5px;
        }

        .chat-message.user {
            background-color: var(--primary-color);
            color: white;
            margin-left: 20%;
        }

        .chat-message.ai {
            background-color: #e9ecef;
            margin-right: 20%;
        }

        .chat-input {
            position: relative;
            margin-top: 15px;
        }

        .chat-input textarea {
            resize: none;
            height: 60px;
        }

        @media (max-width: 768px) {
            .sidebar {
                position: fixed;
                top: 56px;
                left: -100%;
                width: 100%;
                z-index: 1000;
                transition: left 0.3s;
            }

            .sidebar.show {
                left: 0;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark">
        <div class="container-fluid">
            <a class="navbar-brand" href="index.html">
                <i class="bi bi-graph-up"></i> 智能彩票预测助手
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="#"><i class="bi bi-person"></i> 登录</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <div class="container-fluid">
        <div class="row">
            <!-- 侧边栏 -->
            <div class="col-md-3 col-lg-2 sidebar p-0">
                <div class="list-group list-group-flush">
                    <a href="index.html" class="list-group-item list-group-item-action">
                        <i class="bi bi-house-door"></i> 首页
                    </a>
                    <a href="prediction.html" class="list-group-item list-group-item-action">
                        <i class="bi bi-magic"></i> 智能预测
                    </a>
                    <a href="rules.html" class="list-group-item list-group-item-action active">
                        <i class="bi bi-book"></i> 规则解读
                    </a>
                    <a href="#" class="list-group-item list-group-item-action">
                        <i class="bi bi-clock-history"></i> 历史数据
                    </a>
                    <a href="#" class="list-group-item list-group-item-action">
                        <i class="bi bi-bar-chart"></i> 数据分析
                    </a>
                    <a href="#" class="list-group-item list-group-item-action">
                        <i class="bi bi-person-circle"></i> 个人中心
                    </a>
                </div>
            </div>

            <!-- 主内容区 -->
            <div class="col-md-9 col-lg-10 p-4">
                <!-- 彩票类型选择 -->
                <div class="card mb-4">
                    <div class="card-body">
                        <h5 class="card-title">选择彩票类型</h5>
                        <select class="form-select" id="lotteryType">
                            <option value="ssq">双色球</option>
                            <option value="dlt">大乐透</option>
                            <option value="fc3d">福彩3D</option>
                        </select>
                    </div>
                </div>

                <!-- 规则内容 -->
                <div class="card mb-4">
                    <div class="card-body">
                        <h5 class="card-title">玩法规则</h5>
                        <div class="rule-section">
                            <h5><i class="bi bi-info-circle"></i> 基本玩法</h5>
                            <p>双色球由6个红球号码和1个蓝球号码组成，红球号码从1-33中选择，蓝球号码从1-16中选择。</p>
                        </div>
                        <div class="rule-section">
                            <h5><i class="bi bi-trophy"></i> 中奖规则</h5>
                            <p>一等奖：6个红球号码和1个蓝球号码全部相符</p>
                            <p>二等奖：6个红球号码相符，蓝球号码不相符</p>
                            <p>三等奖：5个红球号码和1个蓝球号码相符</p>
                            <p>四等奖：5个红球号码相符，或4个红球号码和1个蓝球号码相符</p>
                            <p>五等奖：4个红球号码相符，或3个红球号码和1个蓝球号码相符</p>
                            <p>六等奖：1个蓝球号码相符</p>
                        </div>
                        <div class="rule-section">
                            <h5><i class="bi bi-cash-stack"></i> 投注方式</h5>
                            <p>1. 单式投注：选择6个红球号码和1个蓝球号码</p>
                            <p>2. 复式投注：选择超过6个红球号码或超过1个蓝球号码</p>
                            <p>3. 胆拖投注：选择1-5个红球号码作为胆码，再选择其他红球号码作为拖码</p>
                        </div>
                    </div>
                </div>

                <!-- AI问答区域 -->
                <div class="card">
                    <div class="card-body">
                        <h5 class="card-title">AI智能问答</h5>
                        <div class="chat-container" id="chatContainer">
                            <div class="chat-message ai">
                                您好！我是智能助手，请问有什么可以帮您解答的彩票规则问题吗？
                            </div>
                        </div>
                        <div class="chat-input">
                            <textarea class="form-control" placeholder="请输入您的问题..." id="questionInput"></textarea>
                            <button class="btn btn-primary mt-2" id="sendButton">
                                <i class="bi bi-send"></i> 发送
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        // 移动端侧边栏切换
        document.querySelector('.navbar-toggler').addEventListener('click', function() {
            document.querySelector('.sidebar').classList.toggle('show');
        });

        // 彩票类型切换
        document.getElementById('lotteryType').addEventListener('change', function() {
            // 这里可以添加切换彩票类型后的逻辑
            console.log('Selected lottery type:', this.value);
        });

        // 发送消息
        document.getElementById('sendButton').addEventListener('click', function() {
            const input = document.getElementById('questionInput');
            const question = input.value.trim();
            
            if (question) {
                // 添加用户消息
                addMessage(question, 'user');
                // 清空输入框
                input.value = '';
                // 模拟AI回复
                setTimeout(() => {
                    addMessage('感谢您的提问，我正在处理中...', 'ai');
                }, 500);
            }
        });

        // 添加消息到聊天窗口
        function addMessage(text, type) {
            const container = document.getElementById('chatContainer');
            const message = document.createElement('div');
            message.className = `chat-message ${type}`;
            message.textContent = text;
            container.appendChild(message);
            // 滚动到底部
            container.scrollTop = container.scrollHeight;
        }

        // 回车发送消息
        document.getElementById('questionInput').addEventListener('keypress', function(e) {
            if (e.key === 'Enter' && !e.shiftKey) {
                e.preventDefault();
                document.getElementById('sendButton').click();
            }
        });
    </script>
</body>
</html> 